package a.f.g.a;

import a.c.e;
import a.c.w;

class ub
  implements nc
{
  private double b = 0.5D;
  private int c = 1;
  private int d = 1;
  
  public int a()
  {
    return this.d;
  }
  
  public void a(int paramInt)
  {
    this.d = paramInt;
  }
  
  public int b()
  {
    return this.c;
  }
  
  public void b(int paramInt)
  {
    this.c = paramInt;
  }
  
  public double c()
  {
    return this.b;
  }
  
  public void a(double paramDouble)
  {
    this.b = paramDouble;
  }
  
  public y a(cb paramcb, bb parambb, f paramf)
  {
    boolean bool = xb.r;
    int j = xb.q;
    lb locallb = parambb.d();
    boolean[] arrayOfBoolean = new boolean[locallb.a()];
    int[] arrayOfInt = new int[locallb.a()];
    double[] arrayOfDouble = new double[locallb.a()];
    y localy = paramcb.a();
    e locale1 = paramcb.p();
    a.c.bb localbb = new a.c.bb();
    paramf.a();
    arrayOfBoolean[locale1.f()] = true;
    arrayOfInt[locale1.f()] = 0;
    e locale2 = locale1;
    pb localpb = new pb();
    label347:
    label499:
    do
    {
      if (locale2 == null) {
        break;
      }
      int i = arrayOfInt[locale2.f()];
      Object localObject;
      if (!bool) {
        if (i != 0)
        {
          localObject = locallb.a(locale2).a();
          ((y)localObject).a(localy, localpb);
          double d1 = localy.c((y)localObject);
          double d2 = Math.max(d1 - (paramcb.l() + locallb.a(locale2).l()), 0.001D);
          double d3 = arrayOfDouble[locale2.f()];
          if (!bool) {
            if (d1 > 0.001D) {
              localpb.f(1.0D / d1);
            }
          }
          double d4;
          switch (this.c)
          {
          case 1: 
            d4 = d2 / d3;
            if (bool) {
              break label347;
            }
            if (j == 0) {
              break;
            }
          case 2: 
            d4 = d2 * d2 / (d3 * d3);
            if (bool) {
              break label347;
            }
            if (j == 0) {
              break;
            }
          default: 
            d4 = k.a(d2 / d3, this.c);
          }
          localpb.f(d4 * k.a(this.b, i - 1));
          paramf.a(localpb);
        }
      }
      if (i < this.d)
      {
        localObject = locale2.o();
        do
        {
          if (!((w)localObject).e()) {
            break;
          }
          e locale3 = ((w)localObject).d();
          if (j != 0) {
            break label499;
          }
          if (arrayOfBoolean[locale3.f()] == 0)
          {
            arrayOfBoolean[locale3.f()] = true;
            arrayOfInt[locale3.f()] = (i + 1);
            arrayOfDouble[locale2.f()] += Math.max(locallb.a(locale2.c(locale3)).a(), 0.001D);
            localbb.b(locale3);
          }
          ((w)localObject).f();
        } while (j == 0);
      }
      if ((!bool) && (localbb.isEmpty())) {
        break;
      }
      locale2 = localbb.o();
    } while (j == 0);
    return paramf;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.g.a.ub
 * JD-Core Version:    0.7.0.1
 */